package com.jysz.certificate.persistence.enums.cs;


/**
 * 盘库单的状态 
 * @author xuxiaolong
 */
	public enum CheckStockStatus {
		UNSTART("暂存", 0), FINISHED("已完成", 1);//, CONFIRM_SHOP("确认(驻)", 2),  FINISHED("已完成", 3)

		// 名称
		private String name;
		// 索引
		private int index;

		private CheckStockStatus(String name, int index) {
			this.name = name;
			this.index = index;
		}

		// 根据索引获得名称
		public static String getName(int index) {
			for (CheckStockStatus w : CheckStockStatus.values()) {
				if (w.getIndex() == index) {
					return w.name;
				}
			}
			return null;
		}
		
		// 根据索引获得枚举
		public static CheckStockStatus index(int index) {
			for (CheckStockStatus w : CheckStockStatus.values()) {
				if (w.getIndex() == index) {
					return w;
				}
			}
			return null;
		}

		public String getName() {
			return name;
		}

		public void setName(String name) {
			this.name = name;
		}

		public int getIndex() {
			return index;
		}

		public void setIndex(int index) {
			this.index = index;
		}
	}